package Enume;

import java.util.Iterator;

import org.junit.Test;

public class test {
	public static void main(String[] args) {
		System.out.println(Grade.B.toLocaleString());
		String name = "B";
		Grade bGrade=Grade.valueOf(Grade.class,name);
	}
	@Test
	public void toEnume(){
		String name ="B";
		Grade grade =Grade.valueOf(Grade.class,name);//把字符串转成枚举类
		System.out.println(grade.name());//获取枚举对象的名称
		
		//得到一个枚举类的所有对象
		Grade gs[]=Grade.values();//A B C D E 
		for(Grade g:gs){
			System.out.println(g.name());
			
			
		}
	}
}
